$(function () {

    //顶栏引入
    var _index_top_tab_btn = $(".index-top-tab > a");
    _index_top_tab_btn.eq(1).addClass("active").siblings().removeClass("active");
    setTimeout(function () {
        var _index_top_tab_btn = $(".index-top-tab > a");
        _index_top_tab_btn.eq(1).addClass("active").siblings().removeClass("active");
    },1000);

    //筛选
    var _info_choose_bigbtn = $(".info-choosebar > a");//大筛选按钮
    var _info_choose_slide_box = $(".info-choose-slide-box");//筛选下拉框盒子
    var _info_choose_slide = $(".info-choose-slide > div");//筛选下拉条
    var _info_choose_slide_box_mask = $(".info-choose-slide-box-mask");//筛选框遮罩
    var _info_choose_slidebtn = $(".info-choose-slide > div > a");//小筛选按钮
    _info_choose_bigbtn.on("click",function () {
        var _this = $(this);
        if(_this.is(".active")){
            _this.removeClass("active");
            _info_choose_slide_box.fadeOut(100);
        }else{
            _this.addClass("active").siblings().removeClass("active");
            _info_choose_slide.eq(_this.index()).show().siblings().hide();
            _info_choose_slide_box.fadeIn(100);
        }
    });
    _info_choose_slide_box_mask.on("click",function () {
        _info_choose_slide_box.fadeOut(100);
        _info_choose_bigbtn.removeClass("active");
    });
    _info_choose_slidebtn.on("click",function () {
        var _this = $(this);
        _this.addClass("active").siblings().removeClass("active");
        _info_choose_slide_box.fadeOut(100);
        _info_choose_bigbtn.removeClass("active");
    });

    //列表序号
    var list_flag_arr = [
        "<div class='list-flag list-flag1'>" +
        "<div class='list-flag-icon iconfont icon-jinqi'></div>" +
        "<div class='list-flag-num'>1</div>" +
        "</div>",
        "<div class='list-flag list-flag2'>" +
        "<div class='list-flag-icon iconfont icon-jinqi'></div>" +
        "<div class='list-flag-num'>2</div>" +
        "</div>",
        "<div class='list-flag list-flag3'>" +
        "<div class='list-flag-icon iconfont icon-jinqi'></div>" +
        "<div class='list-flag-num'>3</div>" +
        "</div>"
    ];

    //列表加载后运行，添加列表1、2、3名序号
    var _info_listbox = $(".info-listbox");//列表盒子
    var _info_list_length = _info_listbox.find(".info-list").length;//列表长度
    if(_info_list_length > 3){
        _info_list_length = 3;
    }
    for(var i = 0; i < _info_list_length; i++){
        _info_listbox.find(".info-list").eq(i).find(".info-list-right").append(list_flag_arr[i]);
    }

});